function SaveMapOperation(a,b,c)
{
this.base=MapOperation;
this.base();
var _b=a;
var _a="map.SaveMap";
this.engine=b||"http://lspengine4.go2map.com/MapRendition/Engine";
this.appId=c||"2004";
this.submit=function(a,b,c,d)
{
	try
	{
		var dataEntity=createDataEntityDom(),fs=_b.map.features,ds=[],ps=[],ls=[],rs=[],f=_b.getHbState();
		if(!d)d=!f[0]?"1":(f[1]?"3":"2");
		for(var i=0;i<fs.length;i++)
		{
			if(!_b.getBounds().isIntersect(fs[i].bounds)) continue;
			if(fs[i].xml.getElementsByTagName("Feature").length==0)
			{
				fs[i].objectToXML();
			}
			switch(fs[i].type)
			{
				case "S":ps.push(fs[i]);break;
				case "L":ls.push(fs[i]);break;
				case "R":rs.push(fs[i]);break;
			}
		}
		ds=rs.concat(ls,ps);
		for(var i=0;i<ds.length;i++)
		{
			dataEntity.appendChild(ds[i].xml.cloneNode(true));
		}
		var v,xy,z,u=this.appId;
		v=new SaveMapVariant();
		v.setAPPID(!u?_b.getAppId():u);
		xy=v.centerXY=_b.getCenterX()+","+_b.getCenterY();
		z=v.mpLevel=_b.map.spec.mpLevels[_b.getLevelIndex()].id;
		v.imageType=(!a?"GIF":a);
		v.imageWidth=_b.getMapWidth();
		v.imageHeight=_b.getMapHeight();
		v.responseType=(!b?"JS":b);
		v.mapType=(!d?"1":d)
		var dte=dataEntity.xml;
		dte=dte.replace(/>\s*?</g,"><");
		dte=dte.replace(/[&]/g,"_amp_");
		v.data=dte;
		if(c!=null) v.saveState=c;
		var mq=new MapRequest(_a, v);
		//_b.submit(mq, this,false,this.engine,null,null,"get");
		SEvent.trigger(this,"url",this.engine+"?"+mq.getMapRequestString())
	}
	catch(e)
	{
		e.description=this.getClassName()+".submitSave()::"+e.description;
		Log.write(e.description);
	}
};
this.mapWindowCallback=function( a,b ){};
this.mapResultCallback=function(a)
{
try
{
var b=a.getResult("ImageURL");
if(b!="")
{
SEvent.trigger(this,"imageurl",b)
}
SEvent.trigger(this,"mapresultcallback",a)
}
catch(e)
{
Log.write(e.description);
}
};
function createDataEntityDom()
{
var c=''+'<?xml version="1.0" encoding="GB2312"?>'+'<Data xmlns:v="urn:schemas-microsoft-com:vml">'+'</Data>';
var d=_getDomFromString(c);
var e=d.selectSingleNode("Data");
return e;
};
}
function SaveMapVariant()
{
var t=this,a="MUST_BE_VALIDATED";
t.base=WmspVariant;
t.base();
t.centerXY=a;
t.mpLevel=a;
t.imageType=a;
t.imageWidth=a;
t.imageHeight=a;
t.responseType=a;
t.data=a;
t.mapType=a;
t.saveState="OPTIONAL";
};